<!DOCTYPE html><html lang="zh-CN" data-theme="light"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"><title>小飞侠Pan的Blog - a coder</title><meta name="keywords" content="潘静怡的博客,前端,程序媛"><meta name="author" content="潘静怡"><meta name="copyright" content="潘静怡"><meta name="format-detection" content="telephone=no"><meta name="theme-color" content="#ffffff"><meta name="description" content="一路春光, 一路荆棘, 不虚此行">
<meta property="og:type" content="website">
<meta property="og:title" content="小飞侠Pan的Blog">
<meta property="og:url" content="https://mengqiuleo.gitee.io/index.html">
<meta property="og:site_name" content="小飞侠Pan的Blog">
<meta property="og:description" content="一路春光, 一路荆棘, 不虚此行">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://gitee.com/mengqiuleo/images/raw/master/blog/202202252103634.jpg">
<meta property="article:author" content="潘静怡">
<meta property="article:tag" content="潘静怡的博客,前端,程序媛">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://gitee.com/mengqiuleo/images/raw/master/blog/202202252103634.jpg"><link rel="shortcut icon" href="https://gitee.com/mengqiuleo/images/raw/master/blog/202202252103634.jpg"><link rel="canonical" href="https://mengqiuleo.gitee.io/"><link rel="preconnect" href="//cdn.jsdelivr.net"/><link rel="preconnect" href="//busuanzi.ibruce.info"/><link rel="stylesheet" href="/css/index.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6/css/all.min.css" media="print" onload="this.media='all'"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox.css" media="print" onload="this.media='all'"><script>const GLOBAL_CONFIG = { 
  root: '/',
  algolia: undefined,
  localSearch: {"path":"search.xml","languages":{"hits_empty":"找不到您查询的内容：${query}"}},
  translate: {"defaultEncoding":2,"translateDelay":0,"msgToTraditionalChinese":"繁","msgToSimplifiedChinese":"簡"},
  noticeOutdate: undefined,
  highlight: {"plugin":"highlighjs","highlightCopy":true,"highlightLang":true,"highlightHeightLimit":500},
  copy: {
    success: '复制成功',
    error: '复制错误',
    noSupport: '浏览器不支持'
  },
  relativeDate: {
    homepage: false,
    post: false
  },
  runtime: '天',
  date_suffix: {
    just: '刚刚',
    min: '分钟前',
    hour: '小时前',
    day: '天前',
    month: '个月前'
  },
  copyright: undefined,
  lightbox: 'fancybox',
  Snackbar: undefined,
  source: {
    justifiedGallery: {
      js: 'https://cdn.jsdelivr.net/npm/flickr-justified-gallery@2/dist/fjGallery.min.js',
      css: 'https://cdn.jsdelivr.net/npm/flickr-justified-gallery@2/dist/fjGallery.min.css'
    }
  },
  isPhotoFigcaption: false,
  islazyload: false,
  isAnchor: true
}</script><script id="config-diff">var GLOBAL_CONFIG_SITE = {
  title: '小飞侠Pan的Blog',
  isPost: false,
  isHome: true,
  isHighlightShrink: undefined,
  isToc: false,
  postUpdate: '2022-04-10 20:24:11'
}</script><noscript><style type="text/css">
  #nav {
    opacity: 1
  }
  .justified-gallery img {
    opacity: 1
  }

  #recent-posts time,
  #post-meta time {
    display: inline !important
  }
</style></noscript><script>(win=>{
    win.saveToLocal = {
      set: function setWithExpiry(key, value, ttl) {
        if (ttl === 0) return
        const now = new Date()
        const expiryDay = ttl * 86400000
        const item = {
          value: value,
          expiry: now.getTime() + expiryDay,
        }
        localStorage.setItem(key, JSON.stringify(item))
      },

      get: function getWithExpiry(key) {
        const itemStr = localStorage.getItem(key)

        if (!itemStr) {
          return undefined
        }
        const item = JSON.parse(itemStr)
        const now = new Date()

        if (now.getTime() > item.expiry) {
          localStorage.removeItem(key)
          return undefined
        }
        return item.value
      }
    }
  
    win.getScript = url => new Promise((resolve, reject) => {
      const script = document.createElement('script')
      script.src = url
      script.async = true
      script.onerror = reject
      script.onload = script.onreadystatechange = function() {
        const loadState = this.readyState
        if (loadState && loadState !== 'loaded' && loadState !== 'complete') return
        script.onload = script.onreadystatechange = null
        resolve()
      }
      document.head.appendChild(script)
    })
  
      win.activateDarkMode = function () {
        document.documentElement.setAttribute('data-theme', 'dark')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#0d0d0d')
        }
      }
      win.activateLightMode = function () {
        document.documentElement.setAttribute('data-theme', 'light')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#ffffff')
        }
      }
      const t = saveToLocal.get('theme')
    
          if (t === 'dark') activateDarkMode()
          else if (t === 'light') activateLightMode()
        
      const asideStatus = saveToLocal.get('aside-status')
      if (asideStatus !== undefined) {
        if (asideStatus === 'hide') {
          document.documentElement.classList.add('hide-aside')
        } else {
          document.documentElement.classList.remove('hide-aside')
        }
      }
    
    const detectApple = () => {
      if(/iPad|iPhone|iPod|Macintosh/.test(navigator.userAgent)){
        document.documentElement.classList.add('apple')
      }
    }
    detectApple()
    })(window)</script><link rel="stylesheet" href="/css/social.css" type="text/css"><link rel="stylesheet" href="/css/style.css" type="text/css"><meta name="generator" content="Hexo 5.4.1"></head><body><div id="sidebar"><div id="menu-mask"></div><div id="sidebar-menus"><div class="avatar-img is-center"><img src="https://gitee.com/mengqiuleo/images/raw/master/blog/202202252103634.jpg" onerror="onerror=null;src='/img/friend_404.gif'" alt="avatar"/></div><div class="site-data is-center"><div class="data-item"><a href="/archives/"><div class="headline">文章</div><div class="length-num">15</div></a></div><div class="data-item"><a href="/tags/"><div class="headline">标签</div><div class="length-num">20</div></a></div><div class="data-item"><a href="/categories/"><div class="headline">分类</div><div class="length-num">7</div></a></div></div><hr/><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> 首页</span></a></div><div class="menus_item"><a class="site-page" href="/book/"><i class="fa-fw fa-solid fa-bookmark"></i><span> 前端知识库</span></a></div><div class="menus_item"><a class="site-page" href="/work/"><i class="fa-fw fa fa-heartbeat"></i><span> 在线简历</span></a></div><div class="menus_item"><a class="site-page" href="/categories/"><i class="fa-fw fas fa-folder-open"></i><span> 分类</span></a></div><div class="menus_item"><a class="site-page" href="/archives/"><i class="fa-fw fas fa-archive"></i><span> 时间轴</span></a></div><div class="menus_item"><a class="site-page" href="/tags/"><i class="fa-fw fas fa-tags"></i><span> 标签</span></a></div><div class="menus_item"><a class="site-page" href="/link/"><i class="fa-fw fas fa-link"></i><span> 友情链接</span></a></div><div class="menus_item"><a class="site-page" href="/messageboard/"><i class="fa-fw fa-solid fa-paper-plane"></i><span> 留言板</span></a></div><div class="menus_item"><a class="site-page" href="/about/"><i class="fa-fw fas fa-heart"></i><span> 关于我</span></a></div></div></div></div><div class="page" id="body-wrap"><header class="full_page" id="page-header" style="background-image: url('https://gitee.com/mengqiuleo/images/raw/master/blog/202202252058025.jpg')"><nav id="nav"><span id="blog_name"><a id="site-name" href="/">小飞侠Pan的Blog</a></span><div id="menus"><div id="search-button"><a class="site-page social-icon search"><i class="fas fa-search fa-fw"></i><span> 搜索</span></a></div><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> 首页</span></a></div><div class="menus_item"><a class="site-page" href="/book/"><i class="fa-fw fa-solid fa-bookmark"></i><span> 前端知识库</span></a></div><div class="menus_item"><a class="site-page" href="/work/"><i class="fa-fw fa fa-heartbeat"></i><span> 在线简历</span></a></div><div class="menus_item"><a class="site-page" href="/categories/"><i class="fa-fw fas fa-folder-open"></i><span> 分类</span></a></div><div class="menus_item"><a class="site-page" href="/archives/"><i class="fa-fw fas fa-archive"></i><span> 时间轴</span></a></div><div class="menus_item"><a class="site-page" href="/tags/"><i class="fa-fw fas fa-tags"></i><span> 标签</span></a></div><div class="menus_item"><a class="site-page" href="/link/"><i class="fa-fw fas fa-link"></i><span> 友情链接</span></a></div><div class="menus_item"><a class="site-page" href="/messageboard/"><i class="fa-fw fa-solid fa-paper-plane"></i><span> 留言板</span></a></div><div class="menus_item"><a class="site-page" href="/about/"><i class="fa-fw fas fa-heart"></i><span> 关于我</span></a></div></div><div id="toggle-menu"><a class="site-page"><i class="fas fa-bars fa-fw"></i></a></div></div></nav><div id="site-info"><h1 id="site-title">小飞侠Pan的Blog</h1><div id="site-subtitle"><span id="subtitle"></span></div><div id="site_social_icons"><a class="social-icon" href="https://blog.csdn.net/weixin_52834435?spm=1000.2115.3001.5343" target="_blank" title="CSDN"><i class="iconfont icon-csdn1"></i></a><a class="social-icon" href="https://gitee.com/mengqiuleo" target="_blank" title="Gitee"><i class="iconfont icon-gitee2"></i></a><a class="social-icon" href="https://gitee.com/mengqiuleo/images/raw/master/blog/202202252130203.jpg" target="_blank" title="QQ"><i class="fa-brands fa-qq"></i></a><a class="social-icon" href="https://gitee.com/mengqiuleo/images/raw/master/blog/202202252130201.jpg" target="_blank" title="WeChat"><i class="fa-brands fa-weixin"></i></a></div></div><div id="scroll-down"><i class="fas fa-angle-down scroll-down-effects"></i></div></header><main class="layout" id="content-inner"><div class="recent-posts" id="recent-posts"><div class="recent-post-item"><div class="post_cover left"><a href="/2022/02/25/life/hello-world/" title="Hello everyone!"><img class="post_bg" src="https://gitee.com/mengqiuleo/images/raw/master/blog/202202252058024.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="Hello everyone!"></a></div><div class="recent-post-info"><a class="article-title" href="/2022/02/25/life/hello-world/" title="Hello everyone!">Hello everyone!</a><div class="article-meta-wrap"><span class="article-meta"><i class="fas fa-thumbtack sticky"></i><span class="sticky">置顶</span><span class="article-meta-separator">|</span></span><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2022-02-25T07:26:11.077Z" title="发表于 2022-02-25 15:26:11">2022-02-25</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/%E9%9A%8F%E7%AC%94/">随笔</a></span></div><div class="content">

这是我的在个人博客上的第一篇文章, 以前的东西都放在CSDN上, 其实很久之前就想搭一个个人博客, 而且在去年双十一的时候,
还在阿里云上买了一个云服务器, 一直闲置, 所以在今年寒假就想着把博客搭起来。
目前这个博客上的文章都搬运自我的CSDN, 文章还没有迁移完, 后续更新的文章会同步上传到CSDN和个人博客上。

第一篇文章就先做个自我介绍吧！👉点击这里






</div></div></div><div class="recent-post-item"><div class="post_cover right"><a href="/2022/02/26/life/2021%E5%B9%B4%E5%BA%A6%E6%80%BB%E7%BB%93/" title="小飞侠Pan的2021年度总结"><img class="post_bg" src="https://gitee.com/mengqiuleo/images/raw/master/blog/202202252058024.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="小飞侠Pan的2021年度总结"></a></div><div class="recent-post-info"><a class="article-title" href="/2022/02/26/life/2021%E5%B9%B4%E5%BA%A6%E6%80%BB%E7%BB%93/" title="小飞侠Pan的2021年度总结">小飞侠Pan的2021年度总结</a><div class="article-meta-wrap"><span class="article-meta"><i class="fas fa-thumbtack sticky"></i><span class="sticky">置顶</span><span class="article-meta-separator">|</span></span><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2022-02-26T09:49:22.565Z" title="发表于 2022-02-26 17:49:22">2022-02-26</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/%E9%9A%8F%E7%AC%94/">随笔</a></span></div><div class="content">今年一月份，也就是大一寒假的时候，学了javase和数据结构的一部分，尚硅谷的javase的700集的视频看了差不多有600集，开学以后，感觉数据结构和javase有点忘，所以开学的3、4月份基本上就在继续学习这些。然后刚开学还参加了三创赛，我是组长，那段时间有点忙，但最后连校赛都没过。以后这种比赛就没时间参加了，剩下的时间就要专注于提高自己的编程能力了。
​     差不多在开学的时候，我就已经开始刷算法题了。但都只是仅限于在纸上写，没有在电脑编译器上敲，所以编程水平并没有很大的提高。到了4月份的时候，我又开始学习计算机组成原理，学了几天后发现自己其实看的不是很懂，而且自己有花费了一些事件在寻找csapp的资源上，所以浪费了一些时间。
看csapp算是一个坑吧，太深奥，根本看不懂，只能看懂第一章。
​     到了5月底，运动会让每个人跳健美操，差不多练了有一个多月，这一个多月基本上啥也没干，健美操结束以后，学校有准备蓝桥杯的校内初选，所以有花了许多时间在那上面，结果快放假的时候，校内选拔，自己也没有很好的成绩。唉！6月份基本上就是在准备复习了，啥也没干。
总之，2021年的上半年就 ...</div></div></div><div class="recent-post-item"><div class="post_cover left"><a href="/2022/02/26/%E6%B5%8F%E8%A7%88%E5%99%A8/cookie/" title="前端浏览器之Cookie，Session，LocalStorage，SessionStorage，JWT"><img class="post_bg" src="https://gitee.com/mengqiuleo/images/raw/master/blog/202202261905291.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="前端浏览器之Cookie，Session，LocalStorage，SessionStorage，JWT"></a></div><div class="recent-post-info"><a class="article-title" href="/2022/02/26/%E6%B5%8F%E8%A7%88%E5%99%A8/cookie/" title="前端浏览器之Cookie，Session，LocalStorage，SessionStorage，JWT">前端浏览器之Cookie，Session，LocalStorage，SessionStorage，JWT</a><div class="article-meta-wrap"><span class="article-meta"><i class="fas fa-thumbtack sticky"></i><span class="sticky">置顶</span><span class="article-meta-separator">|</span></span><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2022-02-26T10:14:28.399Z" title="发表于 2022-02-26 18:14:28">2022-02-26</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/%E6%B5%8F%E8%A7%88%E5%99%A8/">浏览器</a></span></div><div class="content">CookieCookie是一种存储机制，
当我们第一次请求网页内容的时候是没有任何cookie的，服务器在收到请求以后会在HTTP响应里添加头部Set-Cookie，并且在Set-cookie里进行标识，在下一次请求的时候浏览器就会在HTTP请求里添加头部Cookie，并且用上Set-Cookie里的标识，这样服务器就可以给不同用户匹配不同的内容了。
因为每一次浏览器请求都要带上Cookie，因此就把Cookie设计的很小，不能超过4KB，但大部分情况会更小。
通常，它用于判断两个请求是否来自于同一个浏览器，例如用户保持登录状态。
Cookie 主要用于下面三个目的

会话管理登陆、购物车、游戏得分或者服务器应该记住的其他内容

个性化用户偏好、主题或者其他设置

追踪记录和分析用户行为


HTTP Cookie 机制是 HTTP 协议无状态的一种补充和改良

Cookie的特性：
Cookie一旦创建成功，名称就无法修改
Cookie是无法跨域名的，也就是说a域名和b域名下的cookie是无法共享的，这也是由Cookie的隐私安全性决定的，这样就能够阻止非法获取其他网站的Cooki ...</div></div></div><div class="recent-post-item"><div class="post_cover right"><a href="/2022/02/26/js%E5%BC%82%E6%AD%A5/promise/" title="Promise的理解与使用"><img class="post_bg" src="https://gitee.com/mengqiuleo/images/raw/master/blog/202202252130198.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="Promise的理解与使用"></a></div><div class="recent-post-info"><a class="article-title" href="/2022/02/26/js%E5%BC%82%E6%AD%A5/promise/" title="Promise的理解与使用">Promise的理解与使用</a><div class="article-meta-wrap"><span class="article-meta"><i class="fas fa-thumbtack sticky"></i><span class="sticky">置顶</span><span class="article-meta-separator">|</span></span><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2022-02-26T10:31:52.813Z" title="发表于 2022-02-26 18:31:52">2022-02-26</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/JS%E5%BC%82%E6%AD%A5/">JS异步</a></span></div><div class="content">一、Promise的理解与使用(一)Promise是什么Ⅰ基本理解1、概念:
​    Promise是异步编程的一种解决方案，比传统的解决方案——回调函数和事件——更合理和更强大。所谓Promise，简单说就是一个容器，里面保存着某个未来才会结束的事件（通常是一个异步操作）的结果。
通俗讲，Promise是一个许诺、承诺,是对未来事情的承诺，承诺不一定能完成，但是无论是否能完成都会有一个结果。

Pending  正在做。。。
Resolved 完成这个承诺
Rejected 这个承诺没有完成，失败了

​    Promise 用来预定一个不一定能完成的任务，要么成功，要么失败
​    在具体的程序中具体的体现，通常用来封装一个异步任务，提供承诺结果
Promise 是异步编程的一种解决方案，主要用来解决回调地狱的问题，可以有效的减少回调嵌套。真正解决需要配合async/await
2、特点:
​    (1)对象的状态不受外界影响。Promise对象代表一个异步操作，有三种状态：Pending（进行中）、Resolved（已完成，又称Fulfilled）和Rejected（已失 ...</div></div></div><div class="recent-post-item"><div class="post_cover left"><a href="/2022/02/26/life/%E5%B0%8F%E9%A3%9E%E4%BE%A0Pan%E7%9A%84%E5%AF%92%E5%81%87%E6%80%BB%E7%BB%93/" title="小飞侠Pan的大二上半学期寒假总结"><img class="post_bg" src="https://gitee.com/mengqiuleo/images/raw/master/blog/202202252058024.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="小飞侠Pan的大二上半学期寒假总结"></a></div><div class="recent-post-info"><a class="article-title" href="/2022/02/26/life/%E5%B0%8F%E9%A3%9E%E4%BE%A0Pan%E7%9A%84%E5%AF%92%E5%81%87%E6%80%BB%E7%BB%93/" title="小飞侠Pan的大二上半学期寒假总结">小飞侠Pan的大二上半学期寒假总结</a><div class="article-meta-wrap"><span class="article-meta"><i class="fas fa-thumbtack sticky"></i><span class="sticky">置顶</span><span class="article-meta-separator">|</span></span><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2022-02-26T09:49:07.697Z" title="发表于 2022-02-26 17:49:07">2022-02-26</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/%E9%9A%8F%E7%AC%94/">随笔</a></span></div><div class="content">​    这个寒假差不多有50天，过年前每天都有坚持学习，过年后从初一到初六还是有规律的学习，但是从初七到正月十五，基本上没有学习，浪费了一个星期，初七到初九那两天入坑了树莓派，所以花了两三天紧急学习了python和linux。但是后来因为学校的网络id不知道怎么写，所以就暂时放弃了。
过年前把JavaScript和css还有es6重新深入学习了一遍，把一些面试题看懂了，还在掘金和CSDN看了一些优质博客，然后又学习了浏览器的渲染机制，跨站脚本攻击，js异步编程，手写Promise，也了解了一点http协议。CSDN上的笔记也写了很多。算法题也刷了一点，各种刷题网站都试过了一遍，最后还是发现洛谷最好用。
​    过年之后，把vue看完了，还配套做了一个vue的项目，然后着手搭建个人博客，也加入了一些比较有学习氛围知识星球。
之后去学校的安排：背前端三件套面试题，深入学习浏览器渲染机制，然后学习计网，再写一个vue项目。再次优化博客，争取把博客部署到自己的云服务器上。
</div></div></div><div class="recent-post-item"><div class="post_cover right"><a href="/2022/02/26/js/%E5%8E%9F%E5%9E%8B%E4%B8%8E%E5%8E%9F%E5%9E%8B%E9%93%BE/" title="原型与原型链"><img class="post_bg" src="https://gitee.com/mengqiuleo/images/raw/master/blog/202202252130198.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="原型与原型链"></a></div><div class="recent-post-info"><a class="article-title" href="/2022/02/26/js/%E5%8E%9F%E5%9E%8B%E4%B8%8E%E5%8E%9F%E5%9E%8B%E9%93%BE/" title="原型与原型链">原型与原型链</a><div class="article-meta-wrap"><span class="article-meta"><i class="fas fa-thumbtack sticky"></i><span class="sticky">置顶</span><span class="article-meta-separator">|</span></span><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2022-02-26T10:42:32.957Z" title="发表于 2022-02-26 18:42:32">2022-02-26</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/JS%E9%AB%98%E7%BA%A7/">JS高级</a></span></div><div class="content">一.原型[prototype]1.函数的prototype属性
并不是所有对象都能有prototype,只有函数才有prototype属性，每个函数都有一个prototype属性, 它默认指向一个Object空对象(即称为: 原型对象)

prototype也是一个对象，而且默认包含一个constructor属性，这个constructor属性指向函数自己
123456function Person()&#123;    this.name=&#x27;my name&#x27;;&#125;var p=new Person();//函数的prototype.constructor指向自己console.log(Person.prototype.constructor===Person);//true
原型对象中有一个属性constructor, 它指向函数对象
constructor：当一个函数被用来构造一个对象时，那这个函数就被成为constructor
实例的构造函数属性（constructor）指向构造函数。
12345678910111213function Person() ...</div></div></div><div class="recent-post-item"><div class="post_cover left"><a href="/2022/02/26/%E6%B5%8F%E8%A7%88%E5%99%A8/%E6%94%BB%E5%87%BB/" title="前端面试之浏览器安全"><img class="post_bg" src="https://gitee.com/mengqiuleo/images/raw/master/blog/202202261903367.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="前端面试之浏览器安全"></a></div><div class="recent-post-info"><a class="article-title" href="/2022/02/26/%E6%B5%8F%E8%A7%88%E5%99%A8/%E6%94%BB%E5%87%BB/" title="前端面试之浏览器安全">前端面试之浏览器安全</a><div class="article-meta-wrap"><span class="article-meta"><i class="fas fa-thumbtack sticky"></i><span class="sticky">置顶</span><span class="article-meta-separator">|</span></span><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2022-02-26T10:12:15.520Z" title="发表于 2022-02-26 18:12:15">2022-02-26</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/%E6%B5%8F%E8%A7%88%E5%99%A8/">浏览器</a></span></div><div class="content">XSS攻击1.什么是XSS攻击？概念
XSS全程是Cross Site Scripting,为了和”CSS”区分开来，故简称XSS。翻译过来就是”跨站脚本”。XSS攻击是指黑客往HTML文件中或DOM中注入恶意脚本，从而在用户浏览页面时，利用注入的恶意脚本对用户实施攻击的一种手段。
最开始的时候，这种攻击是通过跨域实现的，所以叫”跨域脚本”。但是发展到如今，往HTML文件注入恶意代码的方式越来越多，所以是否跨域注入脚本已经不是唯一的注入手段了，但是XSS这个名字却一直保留至今。
XSS 的本质是因为网站没有对恶意代码进行过滤，与正常的代码混合在一起了，浏览器没有办法分辨哪些脚本是可信的，从而导致了恶意代码的执行。
攻击者可以通过这种攻击方式可以进行以下操作：
获取页面的数据，如DOM、cookie、localStorage；
DOS攻击，发送合理请求，占用服务器资源，从而使用户无法访问服务器；
破坏页面结构；
流量劫持（将链接指向某网站）；
可以窃取Cookie信息，恶意代码通过document.cookie获取Cookie信息，然后通过XMLHttpRequest加上Cors功能将数 ...</div></div></div><div class="recent-post-item"><div class="post_cover right"><a href="/2022/02/26/ajax/ajax/" title="JS异步之ajax"><img class="post_bg" src="https://gitee.com/mengqiuleo/images/raw/master/blog/202202252130198.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="JS异步之ajax"></a></div><div class="recent-post-info"><a class="article-title" href="/2022/02/26/ajax/ajax/" title="JS异步之ajax">JS异步之ajax</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2022-02-26T10:53:56.362Z" title="发表于 2022-02-26 18:53:56">2022-02-26</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/ajax/">ajax</a></span></div><div class="content">1.基本使用1、XMLHttpRequest，AJAX 的所有操作都是通过该对象进行的。
2、ajax请求状态:xhr.readyState    0：请求未初始化，还没有调用 open()。
​    1：请求已经建立，但是还没有发送，还没有调用 send()。
​    2：请求已发送，正在处理中（通常现在可以从响应中获取内容头）。
​    3：请求在处理中；通常响应中已有部分数据可用了，没有全部完成。
​    4：响应已完成；您可以获取并使用服务器的响应了
3.使用步骤：
12345678910111213141516171) 创建 XMLHttpRequest 对象var xhr = new XMLHttpRequest();2) 设置请求信息xhr.open(method, url);//可以设置请求头，一般不设置xhr.setRequestHeader(&#x27;Content-Type&#x27;, &#x27;application/x-www-form-urlencoded&#x27;);3) 发送请求xhr.send(body) //get 请求不传 body ...</div></div></div><div class="recent-post-item"><div class="post_cover left"><a href="/2022/02/26/js/call%E5%92%8Cbind%E5%92%8Capply/" title="JS基本语法之call/bind/apply"><img class="post_bg" src="https://gitee.com/mengqiuleo/images/raw/master/blog/202202252130198.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="JS基本语法之call/bind/apply"></a></div><div class="recent-post-info"><a class="article-title" href="/2022/02/26/js/call%E5%92%8Cbind%E5%92%8Capply/" title="JS基本语法之call/bind/apply">JS基本语法之call/bind/apply</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2022-02-26T10:52:29.044Z" title="发表于 2022-02-26 18:52:29">2022-02-26</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/JS/">JS</a></span></div><div class="content">一.作用call() 方法call() 方法的作用：可以调用一个函数，与此同时，它还可以改变这个函数内部的 this 指向。
call() 方法的另一个应用：可以实现继承。之所以能实现继承，其实是利用了上面的作用。
语法：
1fn1.call(想要将this指向哪里, 函数实参1, 函数实参2);

注：第一个参数中，如果不需要改变 this 指向，则传 null。
​        当第一个参数为null、undefined的时候，默认指向window(在浏览器中)。
​        改变this指向后原函数会立即执行，且此方法只是临时改变this指向一次。
举例1：
123456789const obj1 = &#123;    nickName: &#x27;qianguyihao&#x27;,    age: 28,&#125;;function fn1() &#123;    console.log(this);    console.log(this.nickName);&#125;fn1.call(this); // this的指向并没有被改变，此时相当于 fn1(); ...</div></div></div><div class="recent-post-item"><div class="post_cover right"><a href="/2022/02/26/js/%E6%95%B0%E6%8D%AE%E7%B1%BB%E5%9E%8B%E5%8F%8A%E5%85%B6%E5%88%A4%E6%96%AD/" title="JS基础之数据类型及其判断"><img class="post_bg" src="https://gitee.com/mengqiuleo/images/raw/master/blog/202202252130198.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="JS基础之数据类型及其判断"></a></div><div class="recent-post-info"><a class="article-title" href="/2022/02/26/js/%E6%95%B0%E6%8D%AE%E7%B1%BB%E5%9E%8B%E5%8F%8A%E5%85%B6%E5%88%A4%E6%96%AD/" title="JS基础之数据类型及其判断">JS基础之数据类型及其判断</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2022-02-26T10:49:21.438Z" title="发表于 2022-02-26 18:49:21">2022-02-26</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/JS/">JS</a></span></div><div class="content">一.JS 中一共有八种数据类型
基本数据类型（值类型）：String 字符串、Number 数值、BigInt 大型数值、Boolean 布尔值、Null 空值、Undefined 未定义、Symbol。
引用数据类型（引用类型）：Object 对象。

注意：内置对象 Function、Array、Date、RegExp、Error 等都是属于 Object 类型。也就是说，除了那七种基本数据类型之外，其他的，都称之为 Object 类型。
BigInt 和 Symbol 是ES6中新增的类型。
二.栈内存和堆内存JS 中，所有的变量都是保存在栈内存中的。
基本数据类型：
基本数据类型的值，直接保存在栈内存中。值与值之间是独立存在，修改一个变量不会影响其他的变量。
引用数据类型：
对象是保存到堆内存中的。每创建一个新的对象，就会在堆内存中开辟出一个新的空间；而变量保存了对象的内存地址（对象的引用），保存在栈内存当中。如果两个变量保存了同一个对象的引用，当一个通过一个变量修改属性时，另一个也会受到影响。
三.基本数据类型：Null 和 UndefinedNull：空对象null 专门用 ...</div></div></div><nav id="pagination"><div class="pagination"><span class="page-number current">1</span><a class="page-number" href="/page/2/#content-inner">2</a><a class="extend next" rel="next" href="/page/2/#content-inner"><i class="fas fa-chevron-right fa-fw"></i></a></div></nav></div><div class="aside-content" id="aside-content"><div class="card-widget card-info"><div class="is-center"><div class="avatar-img"><img src="https://gitee.com/mengqiuleo/images/raw/master/blog/202202252103634.jpg" onerror="this.onerror=null;this.src='/img/friend_404.gif'" alt="avatar"/></div><div class="author-info__name">潘静怡</div><div class="author-info__description">一路春光, 一路荆棘, 不虚此行</div></div><div class="card-info-data is-center"><div class="card-info-data-item"><a href="/archives/"><div class="headline">文章</div><div class="length-num">15</div></a></div><div class="card-info-data-item"><a href="/tags/"><div class="headline">标签</div><div class="length-num">20</div></a></div><div class="card-info-data-item"><a href="/categories/"><div class="headline">分类</div><div class="length-num">7</div></a></div></div><a id="card-info-btn" target="_blank" rel="noopener" href="https://blog.csdn.net/weixin_52834435?type=blog"><i class="iconfont icon-csdn1"></i><span>Follow Me</span></a><div class="card-info-social-icons is-center"><a class="social-icon" href="https://blog.csdn.net/weixin_52834435?spm=1000.2115.3001.5343" target="_blank" title="CSDN"><i class="iconfont icon-csdn1"></i></a><a class="social-icon" href="https://gitee.com/mengqiuleo" target="_blank" title="Gitee"><i class="iconfont icon-gitee2"></i></a><a class="social-icon" href="https://gitee.com/mengqiuleo/images/raw/master/blog/202202252130203.jpg" target="_blank" title="QQ"><i class="fa-brands fa-qq"></i></a><a class="social-icon" href="https://gitee.com/mengqiuleo/images/raw/master/blog/202202252130201.jpg" target="_blank" title="WeChat"><i class="fa-brands fa-weixin"></i></a></div></div><div class="card-widget card-announcement"><div class="item-headline"><i class="fas fa-bullhorn fa-shake"></i><span>公告</span></div><div class="announcement_content">This is my Blog</div></div><div class="sticky_layout"><div class="card-widget card-recent-post"><div class="item-headline"><i class="fas fa-history"></i><span>最新文章</span></div><div class="aside-list"><div class="aside-list-item"><a class="thumbnail" href="/2022/02/26/ajax/ajax/" title="JS异步之ajax"><img src="https://gitee.com/mengqiuleo/images/raw/master/blog/202202252130198.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="JS异步之ajax"/></a><div class="content"><a class="title" href="/2022/02/26/ajax/ajax/" title="JS异步之ajax">JS异步之ajax</a><time datetime="2022-02-26T10:53:56.362Z" title="发表于 2022-02-26 18:53:56">2022-02-26</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/2022/02/26/js/call%E5%92%8Cbind%E5%92%8Capply/" title="JS基本语法之call/bind/apply"><img src="https://gitee.com/mengqiuleo/images/raw/master/blog/202202252130198.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="JS基本语法之call/bind/apply"/></a><div class="content"><a class="title" href="/2022/02/26/js/call%E5%92%8Cbind%E5%92%8Capply/" title="JS基本语法之call/bind/apply">JS基本语法之call/bind/apply</a><time datetime="2022-02-26T10:52:29.044Z" title="发表于 2022-02-26 18:52:29">2022-02-26</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/2022/02/26/js/%E6%95%B0%E6%8D%AE%E7%B1%BB%E5%9E%8B%E5%8F%8A%E5%85%B6%E5%88%A4%E6%96%AD/" title="JS基础之数据类型及其判断"><img src="https://gitee.com/mengqiuleo/images/raw/master/blog/202202252130198.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="JS基础之数据类型及其判断"/></a><div class="content"><a class="title" href="/2022/02/26/js/%E6%95%B0%E6%8D%AE%E7%B1%BB%E5%9E%8B%E5%8F%8A%E5%85%B6%E5%88%A4%E6%96%AD/" title="JS基础之数据类型及其判断">JS基础之数据类型及其判断</a><time datetime="2022-02-26T10:49:21.438Z" title="发表于 2022-02-26 18:49:21">2022-02-26</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/2022/02/26/js/%E6%95%B0%E7%BB%84/" title="JS基本语法之数组"><img src="https://gitee.com/mengqiuleo/images/raw/master/blog/202202252130198.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="JS基本语法之数组"/></a><div class="content"><a class="title" href="/2022/02/26/js/%E6%95%B0%E7%BB%84/" title="JS基本语法之数组">JS基本语法之数组</a><time datetime="2022-02-26T10:47:39.357Z" title="发表于 2022-02-26 18:47:39">2022-02-26</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/2022/02/26/js/%E5%8E%9F%E5%9E%8B%E4%B8%8E%E5%8E%9F%E5%9E%8B%E9%93%BE/" title="原型与原型链"><img src="https://gitee.com/mengqiuleo/images/raw/master/blog/202202252130198.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="原型与原型链"/></a><div class="content"><a class="title" href="/2022/02/26/js/%E5%8E%9F%E5%9E%8B%E4%B8%8E%E5%8E%9F%E5%9E%8B%E9%93%BE/" title="原型与原型链">原型与原型链</a><time datetime="2022-02-26T10:42:32.957Z" title="发表于 2022-02-26 18:42:32">2022-02-26</time></div></div></div></div><div class="card-widget card-categories"><div class="item-headline">
            <i class="fas fa-folder-open"></i>
            <span>分类</span>
            
            </div>
            <ul class="card-category-list" id="aside-cat-list">
            <li class="card-category-list-item "><a class="card-category-list-link" href="/categories/JS/"><span class="card-category-list-name">JS</span><span class="card-category-list-count">3</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/categories/JS%E5%BC%82%E6%AD%A5/"><span class="card-category-list-name">JS异步</span><span class="card-category-list-count">2</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/categories/JS%E9%AB%98%E7%BA%A7/"><span class="card-category-list-name">JS高级</span><span class="card-category-list-count">3</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/categories/PTA%E4%B9%99%E7%BA%A7/"><span class="card-category-list-name">PTA乙级</span><span class="card-category-list-count">1</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/categories/ajax/"><span class="card-category-list-name">ajax</span><span class="card-category-list-count">1</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/categories/%E6%B5%8F%E8%A7%88%E5%99%A8/"><span class="card-category-list-name">浏览器</span><span class="card-category-list-count">2</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/categories/%E9%9A%8F%E7%AC%94/"><span class="card-category-list-name">随笔</span><span class="card-category-list-count">3</span></a></li>
            </ul></div><div class="card-widget card-tags"><div class="item-headline"><i class="fas fa-tags"></i><span>标签</span></div><div class="card-tag-cloud"><a href="/tags/%E7%AE%97%E6%B3%95/" style="font-size: 1.15em; color: rgb(49, 56, 11)">算法</a><a href="/tags/C/" style="font-size: 1.15em; color: rgb(153, 184, 27)">C++</a><a href="/tags/ajax/" style="font-size: 1.15em; color: rgb(80, 75, 134)">ajax</a><a href="/tags/JS/" style="font-size: 1.45em; color: rgb(143, 165, 0)">JS</a><a href="/tags/call/" style="font-size: 1.15em; color: rgb(33, 188, 196)">call</a><a href="/tags/bind/" style="font-size: 1.15em; color: rgb(167, 195, 170)">bind</a><a href="/tags/apply/" style="font-size: 1.15em; color: rgb(196, 40, 113)">apply</a><a href="/tags/%E4%BD%9C%E7%94%A8%E5%9F%9F/" style="font-size: 1.15em; color: rgb(33, 10, 150)">作用域</a><a href="/tags/%E6%89%8B%E5%86%99%E9%A2%98/" style="font-size: 1.15em; color: rgb(184, 21, 15)">手写题</a><a href="/tags/JS%E5%BC%82%E6%AD%A5/" style="font-size: 1.15em; color: rgb(18, 19, 37)">JS异步</a><a href="/tags/Promise/" style="font-size: 1.15em; color: rgb(6, 57, 123)">Promise</a><a href="/tags/error/" style="font-size: 1.15em; color: rgb(46, 18, 85)">error</a><a href="/tags/%E9%9A%8F%E7%AC%94/" style="font-size: 1.35em; color: rgb(49, 132, 58)">随笔</a><a href="/tags/%E6%80%BB%E7%BB%93/" style="font-size: 1.35em; color: rgb(36, 0, 172)">总结</a><a href="/tags/cookie/" style="font-size: 1.15em; color: rgb(48, 142, 93)">cookie</a><a href="/tags/%E6%B5%8F%E8%A7%88%E5%99%A8/" style="font-size: 1.25em; color: rgb(72, 147, 53)">浏览器</a><a href="/tags/%E5%AE%89%E5%85%A8/" style="font-size: 1.15em; color: rgb(126, 49, 137)">安全</a><a href="/tags/%E5%8E%9F%E5%9E%8B%E9%93%BE/" style="font-size: 1.15em; color: rgb(41, 51, 151)">原型链</a><a href="/tags/%E6%95%B0%E6%8D%AE%E7%B1%BB%E5%9E%8B/" style="font-size: 1.15em; color: rgb(69, 55, 159)">数据类型</a><a href="/tags/%E6%95%B0%E7%BB%84/" style="font-size: 1.15em; color: rgb(9, 9, 55)">数组</a></div></div><div class="card-widget card-archives"><div class="item-headline"><i class="fas fa-archive"></i><span>归档</span></div><ul class="card-archive-list"><li class="card-archive-list-item"><a class="card-archive-list-link" href="/archives/2022/02/"><span class="card-archive-list-date">二月 2022</span><span class="card-archive-list-count">15</span></a></li></ul></div><div class="card-widget card-webinfo"><div class="item-headline"><i class="fas fa-chart-line"></i><span>网站资讯</span></div><div class="webinfo"><div class="webinfo-item"><div class="item-name">文章数目 :</div><div class="item-count">15</div></div><div class="webinfo-item"><div class="item-name">已运行时间 :</div><div class="item-count" id="runtimeshow" data-publishDate="2022-02-24T05:57:00.000Z"></div></div><div class="webinfo-item"><div class="item-name">本站总字数 :</div><div class="item-count">36.6k</div></div><div class="webinfo-item"><div class="item-name">本站访客数 :</div><div class="item-count" id="busuanzi_value_site_uv"></div></div><div class="webinfo-item"><div class="item-name">本站总访问量 :</div><div class="item-count" id="busuanzi_value_site_pv"></div></div><div class="webinfo-item"><div class="item-name">最后更新时间 :</div><div class="item-count" id="last-push-date" data-lastPushDate="2022-04-10T12:24:11.128Z"></div></div></div></div></div></div></main><footer id="footer" style="background-image: url('https://gitee.com/mengqiuleo/images/raw/master/blog/202202252058025.jpg')"><div id="footer-wrap"><div class="copyright">&copy;2022 By 潘静怡</div><div class="framework-info"><span>框架 </span><a target="_blank" rel="noopener" href="https://hexo.io">Hexo</a><span class="footer-separator">|</span><span>主题 </span><a target="_blank" rel="noopener" href="https://github.com/jerryc127/hexo-theme-butterfly">Butterfly</a></div><div class="footer_custom_text">welcome to my blog!🤪</div></div></footer></div><div id="rightside"><div id="rightside-config-hide"><button id="translateLink" type="button" title="简繁转换">繁</button><button id="darkmode" type="button" title="浅色和深色模式转换"><i class="fas fa-adjust"></i></button><button id="hide-aside-btn" type="button" title="单栏和双栏切换"><i class="fas fa-arrows-alt-h"></i></button></div><div id="rightside-config-show"><button id="rightside_config" type="button" title="设置"><i class="fas fa-cog fa-spin"></i></button><button id="go-up" type="button" title="回到顶部"><i class="fas fa-arrow-up"></i></button></div></div><div id="local-search"><div class="search-dialog"><nav class="search-nav"><span class="search-dialog-title">本地搜索</span><span id="loading-status"></span><button class="search-close-button"><i class="fas fa-times"></i></button></nav><div class="is-center" id="loading-database"><i class="fas fa-spinner fa-pulse"></i><span>  数据库加载中</span></div><div class="search-wrap"><div id="local-search-input"><div class="local-search-box"><input class="local-search-box--input" placeholder="搜索文章" type="text"/></div></div><hr/><div id="local-search-results"></div></div></div><div id="search-mask"></div></div><div><script src="/js/utils.js"></script><script src="/js/main.js"></script><script src="/js/tw_cn.js"></script><script src="https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox.umd.js"></script><script src="https://cdn.jsdelivr.net/npm/instant.page/instantpage.min.js" type="module"></script><script>function panguFn () {
  if (typeof pangu === 'object') pangu.autoSpacingPage()
  else {
    getScript('https://cdn.jsdelivr.net/npm/pangu/dist/browser/pangu.min.js')
      .then(() => {
        pangu.autoSpacingPage()
      })
  }
}

function panguInit () {
  if (true){
    GLOBAL_CONFIG_SITE.isPost && panguFn()
  } else {
    panguFn()
  }
}

document.addEventListener('DOMContentLoaded', panguInit)</script><script src="/js/search/local-search.js"></script><div class="js-pjax"><script>function subtitleType () {
  fetch('https://v1.hitokoto.cn')
    .then(response => response.json())
    .then(data => {
      if (true) {
        const from = '出自 ' + data.from
        const sub = ["如果结果值得期待,那就勇敢去追"]
        sub.unshift(data.hitokoto, from)
        window.typed = new Typed('#subtitle', {
          strings: sub,
          startDelay: 300,
          typeSpeed: 150,
          loop: true,
          backSpeed: 50,
        })
      } else {
        document.getElementById('subtitle').innerHTML = data.hitokoto
      }
    })
}

if (true) {
  if (typeof Typed === 'function') {
    subtitleType()
  } else {
    getScript('https://cdn.jsdelivr.net/npm/typed.js/lib/typed.min.js').then(subtitleType)
  }
} else {
  subtitleType()
}
</script></div><script src="/js/mobile.js"></script><script defer="defer" id="ribbon" src="https://cdn.jsdelivr.net/npm/butterfly-extsrc@1/dist/canvas-ribbon.min.js" size="150" alpha="0.6" zIndex="-1" mobile="false" data-click="true"></script><script id="click-heart" src="https://cdn.jsdelivr.net/npm/butterfly-extsrc@1/dist/click-heart.min.js" async="async" mobile="false"></script><script src="https://cdn.jsdelivr.net/npm/pjax/pjax.min.js"></script><script>let pjaxSelectors = ["title","#config-diff","#body-wrap","#rightside-config-hide","#rightside-config-show",".js-pjax"]

var pjax = new Pjax({
  elements: 'a:not([target="_blank"])',
  selectors: pjaxSelectors,
  cacheBust: false,
  analytics: false,
  scrollRestoration: false
})

document.addEventListener('pjax:send', function () {

  // removeEventListener scroll 
  window.tocScrollFn && window.removeEventListener('scroll', window.tocScrollFn)
  window.scrollCollect && window.removeEventListener('scroll', scrollCollect)

  typeof preloader === 'object' && preloader.initLoading()
  document.getElementById('rightside').style.cssText = "opacity: ''; transform: ''"
  
  if (window.aplayers) {
    for (let i = 0; i < window.aplayers.length; i++) {
      if (!window.aplayers[i].options.fixed) {
        window.aplayers[i].destroy()
      }
    }
  }

  typeof typed === 'object' && typed.destroy()

  //reset readmode
  const $bodyClassList = document.body.classList
  $bodyClassList.contains('read-mode') && $bodyClassList.remove('read-mode')

})

document.addEventListener('pjax:complete', function () {
  window.refreshFn()

  document.querySelectorAll('script[data-pjax]').forEach(item => {
    const newScript = document.createElement('script')
    const content = item.text || item.textContent || item.innerHTML || ""
    Array.from(item.attributes).forEach(attr => newScript.setAttribute(attr.name, attr.value))
    newScript.appendChild(document.createTextNode(content))
    item.parentNode.replaceChild(newScript, item)
  })

  GLOBAL_CONFIG.islazyload && window.lazyLoadInstance.update()

  typeof chatBtnFn === 'function' && chatBtnFn()
  typeof panguInit === 'function' && panguInit()

  // google analytics
  typeof gtag === 'function' && gtag('config', '', {'page_path': window.location.pathname});

  // baidu analytics
  typeof _hmt === 'object' && _hmt.push(['_trackPageview',window.location.pathname]);

  typeof loadMeting === 'function' && document.getElementsByClassName('aplayer').length && loadMeting()

  // prismjs
  typeof Prism === 'object' && Prism.highlightAll()

  typeof preloader === 'object' && preloader.endLoading()
})

document.addEventListener('pjax:error', (e) => {
  if (e.request.status === 404) {
    pjax.loadUrl('/404.html')
  }
})</script><script async data-pjax src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script></div><!-- hexo injector body_end start -->
  <script data-pjax src="https://cdn.jsdelivr.net/gh/Zfour/hexo-github-calendar@1.21/hexo_githubcalendar.js"></script>
  <script data-pjax>
        function GithubCalendarConfig(){
            var git_githubapiurl ="https://python-gitee-calendar-api.vercel.app/api?mengqiuleo";
            var git_color =['#ebedf0', '#f0fff4', '#dcffe4', '#bef5cb', '#85e89d', '#34d058', '#28a745', '#22863a', '#176f2c', '#165c26', '#144620'];
            var git_user ="mengqiuleo";
            var parent_div_git = document.getElementById('recent-posts');
            var git_div_html = '<div class="recent-post-item" style="width:100%;height:auto;padding:10px;"><div id="github_loading" style="width:10%;height:100%;margin:0 auto;display: block"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"  viewBox="0 0 50 50" style="enable-background:new 0 0 50 50" xml:space="preserve"><path fill="#d0d0d0" d="M25.251,6.461c-10.318,0-18.683,8.365-18.683,18.683h4.068c0-8.071,6.543-14.615,14.615-14.615V6.461z" transform="rotate(275.098 25 25)"><animateTransform attributeType="xml" attributeName="transform" type="rotate" from="0 25 25" to="360 25 25" dur="0.6s" repeatCount="indefinite"></animateTransform></path></svg></div><div id="github_container"></div></div>';
            if(parent_div_git && location.pathname =='/'){
                console.log('已挂载github calendar')
                // parent_div_git.innerHTML=git_div_html+parent_div_git.innerHTML // 无报错，但不影响使用(支持pjax跳转)
                parent_div_git.insertAdjacentHTML("afterbegin",git_div_html) // 有报错，但不影响使用(支持pjax跳转)
            };
            GithubCalendar(git_githubapiurl,git_color,git_user)
        }
        if(document.getElementById('recent-posts')){
            GithubCalendarConfig()
        }
    </script>
    <style>#github_container{min-height:280px}@media screen and (max-width:650px) {#github_container{background-image:;min-height:0px}}</style>
    <style></style><!-- hexo injector body_end end --></body></html>